<template>
	<view class="page content">
		<TopHead :title="'公告详情'"></TopHead>
		<view class="contBox">
			<view class="title1">{{infoData.title}}</view>
			<view class="time">{{infoData.createTime}}</view>
			<view class="details" v-html="infoData.context">
			</view>
		</view>
	</view>
</template>

<script>
	// import HotsellingList from '@/components/basics/hotSellingList.vue';
	// import KnowingFood from '@/components/basics/KnowingFood.vue';
	import TopHead from '../../components/topHead/topHead.vue';
	export default {
		components: {
			TopHead
		},
		data() {
			return {

				list: [], // 列表
				page: 1,
				pageSize: 20, // 
				total: 0, // 总数
				hotList: [], // 热销
				infoData:{} , // 信息存放
			}
		},
		onLoad(options) {
			console.log(options)
			this.id = options.id
			this.initData()
		},
		onShow() {
			this.page = 1
			this.total = 0
			this.list = []
		},
		onReachBottom() {
			// 触底分页
			console.log('触底')
			if (this.total > this.list.length) {
				this.page = parseInt(this.page) + 1
			}
		},
		methods: {
			// 数据请求示例
			initData() {
				let _this = this;
				_this.$http.fetchData({
					url: '/wechatApplet/customer/notice/' + _this.id+'/'+uni.getStorageSync('id'),
					method: 'GET',
					data: {},
					success(res) {
						console.log(res)
						_this.infoData = res.data


					}
				})
			},
			// 查看详情
			announcementDetails(item) {
				console.log(item.id)
				let id = item.id
				let paramsStr = `?id=${id}`
				uni.navigateTo({
					url: `/pages/index/announcementDetails${paramsStr}`
				})
			},

		}
	}
</script>

<style scoped>
	.content {
		background: rgba(62, 122, 233, 0.05);
		padding-bottom: 60rpx;
		height: 100%;
		box-sizing: border-box;
		overflow-y: auto;
	}

	.contBox {
		padding: 30rpx;
		padding-top: 196rpx;
	}

	.title1 {
		font-size: 32rpx;
		font-family: Microsoft YaHei, Microsoft YaHei-Bold;
		font-weight: 700;
		text-align: center;
		color: #5d4529;
	}

	.time {
		font-size: 24rpx;
		font-family: Microsoft YaHei, Microsoft YaHei-Regular;
		font-weight: 400;
		text-align: center;
		color: #b8c5d3;
		margin-top: 30rpx;

	}

	.details {
		margin-top: 30rpx;
		font-size: 28rpx;
		font-family: Microsoft YaHei, Microsoft YaHei-Regular;
		font-weight: 400;
		color: #22172a;
	}
</style>